﻿<div id="filters" data-theme="a" >
	<img class="buttonFilter" src="images/clear.png"/>
	<img class="buttonFilter" src="images/accept.png"/>
	<img class="buttonFilter" src="images/date+.png"/>
</div>
<div data-role="content" data-theme="a" >
	<div data-role="collapsible-set">
		<?php
		include_once "./phpClass/metier/importClass.php";
		$equipments = Iainstruments::getAll();

		$i = 0;
		$id = 0;
		//print_r(sizeof($equipments));

		foreach ($equipments as $index => $equipment) {
			$eName = $equipment -> getDEVICENAME();
			//print_r($eName);
			//print_r($i);

			$arg = array(0 => array('field' => 'device_name', 'operator' => '=', 'value' => $eName));

			$params = McsParameters::getCount($arg);
			//print_r($params);

			
			if ($params==0){
				echo("<div data-role=\"collapsible\" data-mini=\"true\" data-theme=\"b\" data-content-theme=\"a\" data-collapsed-icon=\"delete\" data-expanded-icon=\"delete\" >");
				
				echo("<h2 id=\"eq" . $i . "\" onclick=\"DLParams('" . $eName . "', '" . $i . "')\">");
				echo("<img class=\"buttonStatus\" src=\"images/GreyIcon.png\"/> <div>" . $eName . " <span></span></div>");
				echo("<div id=\"filterEq" . $i . "\" class=\"filterEq\">");
				
				echo("</div>");
				echo("</h2>");
				
//				echo("<form><div id=\"pannelParam" . $i . "\" data-role=\"controlgroup\"></div></form>");
				echo("</div>");
			}
			else{
				echo("<div data-role=\"collapsible\" data-mini=\"true\" data-theme=\"a\" data-content-theme=\"a\" data-collapsed-icon=\"arrow-d\" data-expanded-icon=\"arrow-u\" >");
	
				echo("<h2 id=\"eq" . $i . "\" onclick=\"DLParams('" . $eName . "', '" . $i . "')\">");
				echo("<img class=\"buttonStatus\" src=\"images/GreyIcon.png\"/> <div>" . $eName . " <span>0</span>/" . $params . "</div>");
				echo("<div id=\"filterEq" . $i . "\" class=\"filterEq\">");
	
				echo("</div>");
				echo("</h2>");
	
				echo("<form><div id=\"pannelParam" . $i . "\" data-role=\"controlgroup\"></div></form>");
				echo("</div>");
			}
			$i++;
		}
		?>
	</div>
</div><!-- /content -->
<br />
